package main.utils;

import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

import static main.utils.RiverConstants.CELL_SIZE;
import static main.utils.RiverConstants.FRAME_SIZE;

public class DebugUtils {

    @SuppressWarnings("UnusedDeclaration")
    public static void printBarrierLines(Group root, GridDisplay trap) {
        for (Node node : trap.getChildren()) {
            if (!node.isVisible()) {
                continue;
            }
            double barrierX = trap.getDisplay().getTranslateX() + node.getLayoutX();
            double barrierY = trap.getDisplay().getLayoutY() + node.getLayoutY()/* + GRASS_HEIGHT*/;

            Rectangle rectangle = new Rectangle(barrierX, 0, CELL_SIZE, FRAME_SIZE);
            rectangle.setFill(Color.ORANGE);
            root.getChildren().add(rectangle);

            Rectangle rectangle1 = new Rectangle(0, barrierY, FRAME_SIZE, CELL_SIZE);
            rectangle1.setFill(Color.CYAN);
            root.getChildren().add(rectangle1);
        }
    }

    @SuppressWarnings("UnusedDeclaration")
    public static Rectangle newImageView(boolean visible) {
        Rectangle imageView = new Rectangle(CELL_SIZE, CELL_SIZE);
        imageView.setVisible(visible);
        return imageView;
    }

}
